<template>
<VolHeader style="margin: 0px 0" text="费用表单">
</VolHeader>
 <VolForm
      :label-width="120"
      ref="myform"
      :loadKey="loadKey"
      :formFields="formFields"
      :formRules="formRules"
      disabled=true
    >
    </VolForm> 
  <VolHeader style="margin: 30px 0" text="费用明细">
</VolHeader>
    <vol-table
          ref="tableList"
          :loadKey="true"
          :columns="columns"
          :pagination-hide="false"
          :height="230"
          :defaultLoadPage="true"
          @loadBefore="loadBefore"
          @loadAfter ="loadTableAfter"
          :endEditAfter="endEditAfter"
          url="/api/Fk_reimlist/GetPageData"
          :row-index="true"
          :columnIndex="true"
          :index="true"
          click-edit="false"
          
        ></vol-table>
</template>

<script>
import VolForm from '@/components/basic/VolForm.vue';
import VolTable from "@/components/basic/VolTable.vue";
import VolHeader from '@/components/basic/VolHeader.vue';
export default {
   components: {
    VolForm,
    VolTable,
    VolHeader
  },
  //字段直接从FK_reim.vue中原版，只关注复制{}中内容，外层[]不要动
  //formFields复制editFormFields,
  //formRules复制editFormOptions
  //columns复制"费用明细"的columns
    data() {
      return{
        loadKey: true,
        formFields:{"cn_task":"","txren":"","total_j_big":"","fkcontent":"","reim_id":"","depid_oa":[],"username":"","bdatetime":"","typeid":"","kxprop":"","fj_num":"","fkcontent":"","fsny":"","contract":"","skprop":"","biz":"","skr":"","fkfs":"","fkrq":"","fkbl":"","cardno":"","bank":"","ykcontent":"","remark":"","yk_je":"","yk_je_big":"","sf_je":"","sf_je_big":"","check_je":"","check_je_big":"","total_j":"","total_j_big":"","fujian":""},
        formRules:[[{"title":"序号","required":true,"field":"reim_id","disabled":true,"type":"number"},
                               {"dataKey":"tree_department","data":[],"title":"部门名称","field":"depid_oa","disabled":true,"type":"cascader","hidden":true},
                               {"dataKey":"uerlist","data":[],"title":"姓名","field":"username","disabled":true,"type":"select"},
                               {"title":"填报时间","field":"bdatetime","disabled":true,"type":"datetime"},
                               {"dataKey":"kxxz","data":[],"title":"款项性质","field":"kxprop","type":"select"}
                              ],
                              [{"title":"同行人员","field":"txren"},
                               {"field":'cn_task',"title":'出差任务',"colSize":3},
                               {"dataKey":"typelist","data":[],"title":"业务类型","field":"typeid","disabled":true,"type":"select"}],
                                [{"title":"业务内容","field":"fkcontent","colSize":7},
                               {"dataKey":"yyyymm","data":[],"title":"费用发生时间","field":"fsny","type":"select"},
                               {"title":"附件数量","field":"fj_num","type":"number"}],
                              [{"title":"收款人","field":"skr","colSize":9},{"dataKey":"biz","data":[],"title":"币种","field":"biz","type":"select"}],
                              [{"dataKey":"fkfs","data":[],"title":"付款方式","field":"fkfs","colSize":5,"type":"select"},
                               {"title":"付款日期","field":"fkrq","colSize":4,"type":"date"},
                               {"title":"付款比例(%)","field":"fkbl","type":"number"}],
                               [{"title":"银行卡号","field":"cardno","colSize":6},
                               {"title":"开户行","field":"bank"},],
                               [{"title":"实付金额(大写)","field":"sf_je_big","disabled":true,"colSize":6},
                               {"title":"实付金额","field":"sf_je","type":"decimal"}],
                              [{"title":"审核金额(大写)","field":"check_je_big","disabled":true,"colSize":6},
                               {"title":"审核金额","field":"check_je","type":"decimal"}],
                               [{"title":"含税总额(大写)","field":"total_j_big","disabled":true,"colSize":6},
                               {"title":"总金额(含税)","field":"total_j","disabled":true,"type":"text"}],
                               
                              [{"title":"附件","field":"fujian","type":"file"},]],
        columns:[{field:'reimlist_id',title:'reimlist_id',type:'int',width:80,hidden:true,require:true,align:'left'},
                       {field:'reim_id',title:'reim_id',type:'int',width:80,hidden:true,align:'left'},
                      {field:'fzdate',title:'发票日期',type:'date',width:120,edit:{type:'date'},align:'left',sort:true},
                       {field:'tick_type',title:'发票类别',type:'string',bind:{ key:'pj_typelist',data:[]},width:150,edit:{type:'select'},align:'left',sort:true},
                       {field:'rcntr',title:'成本中心/研发项目',type:'string',bind:{ key:'cntr',data:[]},width:180,edit:{type:'select'},align:'left',sort:true},
                       {field:'fei_type',title:'科目',type:'string',bind:{ key:'fei_typelist',data:[]},width:180,edit:{type:'select'},align:'left'},
                       {field:'cc_bdate',title:'出差起时间',type:'datetime',width:150,edit:{type:'datetime'},align:'left',sort:true},
                       {field:'cc_edate',title:'出差止时间',type:'datetime',width:150,edit:{type:'datetime'},align:'left',sort:true},
                       {field:'t_num',title:'天数',type:'int',width:80,edit:{type:'decimal'},readonly:true,align:'left'},
                       {field:'r_num',title:'人数',type:'int',width:80,edit:{type:'number'},align:'left'},
                       {field:'b_dd',title:'起地',type:'string',width:220,edit:{type:'text'},align:'left'},
                       {field:'e_dd',title:'止地',type:'string',width:220,edit:{type:'text'},align:'left'},
                       {field:'tax',title:'税额',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'ws_je',title:'未税金额',type:'decimal',width:110,readonly:true,edit:{type:'decimal'},align:'left'},
                       {field:'je',title:'金额(含税)',type:'decimal',width:100,edit:{type:'decimal'},align:'left'},
                      
                       {field:'tickno',title:'票号',type:'string',width:100,edit:{type:'text'},require:true,align:'left'},
                       {field:'fujian',title:'附件',type:'file',width:110,align:'left'},
                      
                       {field:'remark',title:'备注',type:'string',width:220,edit:{type:'textarea'},align:'left'},
                       {field:'jk_content',title:'扣减事项',type:'string',width:220,edit:{type:'text'},align:'left'},
                       {field:'jk_je',title:'扣减金额(含税)',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'check_je',title:'审核金额(含税)',type:'decimal',width:110,edit:{type:'decimal'},lign:'left'},]
      }
    },
    mounted() {
      //console.log(this.$refs.tableList.columns);
      this.$nextTick(()=>{//全为只读字段
           this.$refs.tableList.columns.forEach(element => {
         //element.disabled=true;
         element.readonly=true;
      });
     
      })
     
      
    },
    methods: {
      loadBefore(params, callback) {
        params.wheres = [{
          name:"reim_id",
          value:this.$store.getters.data().curr_reimid
        }]
      
        return callback(true);
      }

    }
    
}
</script>

<style>

</style>